
class Hand:
    
    def __init__(self, card1=None, card2=None):
        self._cards = []
        self._cards.append(card1)
        self._cards.append(card2)
        
    def _sort(self):
        self._cards = sorted(self._cards, key=lambda card: card.value, reverse=True)
    
    def _get_cards(self):
        return self._cards
    cards = property(_get_cards)
    
    # contains logic for best Ace Value
    def _get_total(self):
        total = 0
        for card in self._cards:
            total += card.value
        if total > 21:
            for card in self._cards:
                if card.value == 11:
                    card.value = 1
                    total -= 10   
        return total
    total = property(_get_total)
    
    def deal_card(self, card):
        self._cards.append(card)
        
    def display_hand(self):
        for card in self._cards:
            card.display()
